package com.jnu.hc.jnuhcusercms.mapper;

import com.jnu.hc.jnuhcdoccms.dto.OrdersPageRequestDto;
import com.jnu.hc.jnuhcdoccms.dto.ROrderListRequestDto;
import com.jnu.hc.jnuhcdoccms.dto.ROrderListResponseDto;
import com.jnu.hc.jnuhcusercms.domain.Orders;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OrdersMapper {
    int deleteByPrimaryKey(Integer orderId);

    int insert(Orders record);

    int insertSelective(Orders record);

    Orders selectByPrimaryKey(Integer orderId);
    @Select("select orderId,orderDate,userId,hpId,smId,state from orders")
    List<Orders> selectAllOrders();

    List<ROrderListResponseDto> rorderList(ROrderListRequestDto rOrderListRequestDto);

    int updateByPrimaryKeySelective(Orders record);

    int updateByPrimaryKey(Orders record);
    //根据条件查询预约订单总行数
    public int getOrdersCount(OrdersPageRequestDto request);
    //根据条件做预约订单的分页查询
    public List<Orders> listOrders(OrdersPageRequestDto request);

    public Orders getOrdersById(Integer orderId);

    @Update("update orders set state=#{state} where orderId=#{orderId}")
    public int updateOrdersState(Orders orders);

}